const getRows = (req, res) => {
    let list = [];
    for(let i=1;i<11;i++){
        list.push({
            "id":i,
            "productId":"000"+i,
            "productName":"测试产品"+i,
            "productKey":"a1TksOvohXA",
            "protocol":parseInt(i%2)==0?1:2,
            "nodeType":1,
            "networkMode":i%2==0?1:2,
            "dataFormat":i%2==0?1:2,
            "status":i%4==0?0:1,
            "authMode":1,
            "idFlag":0,
            "remark":null,
            "gmtCreated":1631601497123,
            "gmtModified":1631601497123
        });
    }
    list.reverse();

    res.json ({
        success:true,
        errorCode:null,
        errorMessage:null,
        data:{
            rows:list,
            total:10
            
        },
        ts:1653544105
    })
}

export default {
    'GET /api/product/list':getRows,
    'GET /api/product/1':{
        success:true,
        errorCode:null,
        errorMessage:null,
        data:{
            "id":1,
            "productId":"0001",
            "productName":"测试产品1",
            "productKey":"DC.PNDeFDmg4GgFbbx5c2mDGF",
            "productSecret":"DC.SmIYUom1RwatWoS7tCpJXA",
            "protocol":1,
            "nodeType":1,
            "networkMode":2,
            "dataFormat":1,
            "status":1,
            "authMode":1,
            "idFlag":0,
            "remark":null,
            "gmtCreated":1631601497123,
            "gmtModified":1631601497123
        },
        ts:1653544105
    },
    'POST /api/product':{
        success:true,
        errorCode:null,
        errorMessage:null,
        data:null,
        ts:1653544105
    },
    'PUT /api/product/1':{
        success:true,
        errorCode:null,
        errorMessage:null,
        data:null,
        ts:1653544105
    },
    'DELETE /api/product/1':{
        success:true,
        errorCode:null,
        errorMessage:null,
        data:null,
        ts:1653544105
    },
    'PUT /api/product/1/status/1':{
        success:true,
        errorCode:null,
        errorMessage:null,
        data:null,
        ts:1653544105
    },
}
